<extend name="Base/common"/>

<block name="style">
    <link href="__CSS__/recharge.css" rel="stylesheet" type="text/css"/>
</block>
<block name="header">
    <include file="Public/_nav"/>
</block>
<block name="body">
    <div class="common-block">
        <section>
            <div class="row">
                <div class="col-xs-12">
                    <p>&nbsp;</p>
                    <h4>{:L('_RECHARGE_CENTER_')}</h4>
                    <hr class="oneuser-title-hr"/>
                </div>
            </div>
            <include file="_menu"/>
            <div style="margin-bottom: 50px">
                <h3 style="font-size: 16px;font-weight: bold">{:L('_CHOSE_RECHARGE_TYPE_')}</h3>
                <hr/>
                <p>
                <blockquote>
                    <volist name="fields" id="vo">
                        <br/>
                        <label><input data-role="set_field" type="radio" name="field" value="{$vo.FIELD}"
                            <eq name="i" value="1">checked</eq> > {:L('_NOW_RECHARGE_RATIO_')} 1 RMB = {$vo.UNIT} {$vo.scoreType.unit} {$vo.scoreType.title}
                            （{:L('_BALANCE_')}：<span style="color: red">{$vo.have} </span> {$vo.scoreType.unit} {$vo.scoreType.title} ）</label>
                    </volist>
                </blockquote>
                </p>
            </div>
            <div style="margin-bottom: 30px">
                <h3 style="font-size: 16px;font-weight: bold">{:L('_CHOSE_RECHARGE_AMOUNT_')}</h3>
                <hr/>
                <div>
                    <form class="form-horizontal">

                        <php>if($amount){</php>
                        <div class="row">
                            <div class="col-md-2">
                                {:L('_RECHARGE_AMOUNT_')}
                            </div>
                            <div class="col-md-8">
                                <div class="radio">
                                    <volist name="amount" id="vo">
                                        <if condition="floatval($vo) neq 0">

                                            <div class="form-group">
                                                <label><input  data-role="set_amount"   name="amount" type="radio" value="{$vo|floatval}"
                                                    <eq name="i" value="1">checked</eq> > {$vo|floatval}
                                                    {:L('_YUAN_')} </label>
                                            </div>

                                            <else/>

                                        </if>
                                    </volist>
                                </div>
                            </div>

                        </div>

                        <php>}</php>
                        <if condition="modC('CAN_INPUT',1,'pingxx')">
                            <div class="row">
                                <div class="col-md-2">
                                    {:L('_ARBITRARY_AMOUNT_')}
                                </div>
                                <div class="col-md-8">
                                    <div class="form-group">
                                        <label><input id="other" onfocus="$(this).next().focus()" name="amount" type="radio" value="{$vo|floatval}">&nbsp;&nbsp;
                                            <input type="text" class="form-control "
                                                   onfocus="$('#other').prop('checked',true);$('#frm_amount').val(0)"
                                                   style="display: inline-block;width: 120px" name="amount" value=""
                                                   placeholder="{:L('_WRITE_AMOUNT_')}"
                                                   onblur="$('#frm_amount').val(parseFloat($(this).val()))"
                                                    >&nbsp; {:L('_YUAN_')}
                                            <if condition="modC('MIN_AMOUNT',0,'pingxx') neq 0">
                                                （{:L('_MIN_RECHARGE_',array('num'=>modC('MIN_AMOUNT',0,'pingxx')))}）
                                            </if>

                                        </label>

                                    </div>
                                </div>
                            </div>
                        </if>

                    </form>

                </div>

            </div>
            <div>
                <h3 style="font-size: 16px;font-weight: bold">{:L('_CHOSE_PAYMENT_METHOD_')}</h3>
                <hr/>
                <div style="padding: 20px">
                    <if condition="check_is_in_config('alipay_pc_direct',$method)">
                    <label><input type="radio" data-role="set_method" name="type" value="alipay_pc_direct" checked>
                        <img src="__IMG__/alipay.gif"/>
                    </label>
                    </if>


                    <if condition="check_is_in_config('wx_pub_qr',$method)">
                        <label><input type="radio" data-role="set_method" name="type" value="wx_pub_qr" >
                            <img style="width: 135px;height: 45px;" src="__IMG__/wxpay.png"/>
                        </label>
                    </if>


 <!--                   <if condition="check_is_in_config('alipay',$method)">
                        <label><input type="radio" data-role="set_method" name="type" value="alipay" checked>
                            <img src="__IMG__/alipay.gif"/>
                        </label>
                    </if>

                    <if condition="check_is_in_config('alipay_wap',$method)">
                        <label><input type="radio" data-role="set_method" name="type" value="alipay_wap">
                            <img src="__IMG__/alipay.gif"/>
                        </label>
                    </if>

                    <if condition="check_is_in_config('alipay_pc_direct',$method)">
                        <label><input type="radio" data-role="set_method" name="type" value="alipay_pc_direct">
                            <img src="__IMG__/alipay.gif"/>
                        </label>
                    </if>-->


                </div>

            </div>
            <div style="margin-bottom: 30px">
                <div class="clearfix">
                    <form action="{:U('recharge')}" method="post">
                        <input id="frm_amount" type="hidden" name="amount" value="{$amount.0|floatval}">
                        <input id="frm_method" type="hidden" name="method" value="{$method.0}">
                        <input id="frm_field" type="hidden" name="field" value="{$fields.0.FIELD}">
                        <button class="btn btn-primary pull-left" type="submit">{:L('_SUBMIT_ORDER_')}</button>
                    </form>
                </div>

            </div>
        </section>

    </div>

<script>
    $(function(){
        $('[data-role="set_field"]').change(function(){
            $('#frm_field').val($(this).val());
        })

        $('[data-role="set_amount"]').change(function(){
            $('#frm_amount').val($(this).val());
        })

        $('[data-role="set_method"]').change(function(){
            $('#frm_method').val($(this).val());
        })
    })

</script>
</block>

